package com.auth.exception;



import com.marry.core.exception.BusinessException;
import com.marry.core.exception.GobalExceptionHandler;
import com.marry.core.result.Wrapper;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.http.HttpStatus;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.ResponseStatus;
import org.springframework.web.bind.annotation.RestControllerAdvice;

@RestControllerAdvice
public class AuthExceptionHandler  extends GobalExceptionHandler {
    private final Log logger = LogFactory.getLog(getClass());

    @ExceptionHandler(BusinessException.class)
    @ResponseStatus(code = HttpStatus.OK)
    @Override
    public Wrapper handleCustomException(BusinessException e) {
        return super.handleCustomException(e);
    }


    @ExceptionHandler(Exception.class)
    @ResponseStatus(code = HttpStatus.OK)
    @Override
    public Wrapper handleCustomException(Exception e) {
        return  super.handleCustomException(e);
    }


}